<div id="news">
<h4> Phần Mềm </h4>
</div>
<?php
	$sql="SELECT * FROM phanmem  ORDER BY datepost DESC";
	$spql=$dp->QueryAll($sql);
?>
<table width="100%"  border="1" cellspacing="5" cellpadding="5">
	<tr>
		<td width="20" align="center" valign="middle"><strong>STT</strong></td>
		<td  align="center" ><strong>Tên Phần Mềm</strong></td>
		<td width="100" align="center" valign="middle"><strong>Ẩn/Hiện</strong></td>
		<td width="100" align="center" valign="middle"><strong>Tên FIle</strong></td>
		<td width="150" align="center" valign="middle"><strong>Ngày đăng</strong></td>
		<td width="50" align="center" valign="middle"><strong>Xóa</strong></td>
		<td width="50" align="center" valign="middle"><strong>Sửa</strong></td>
	</tr>
	<?php 
		for($i=0;$i<count($spql);$i++)
		{
			$id=$spql[$i]['id'];
			$link=$spql[$i]['link'];
			$name=$spql[$i]['name'];
			$states=$spql[$i]['states'];
			if($spql[$i]['states']==1)
			{
				$states="<img src='IMAGES/hien.png' />";
			}
			else
			{
				$states="<img src='IMAGES/an.png' />";
			}
			$datepost=$spql[$i]['datepost'];
		    $delete="<img src='IMAGES/xoa.png' />";
			$update="<img src='IMAGES/sua.png' />";
	?>
	<tr>
		<td width="20" align="center" valign="middle"><?php echo ($i+1); ?></td>
	     <td ><?php echo $name; ?></td>
		<td align="center"> <a href="index.php?option=phanmem&cat=states&id=<?php echo $id?>">
			<?php echo $states;?>
			</a></td>
			<td align="center"><?php echo $link;?></td>
		<td align="center"><?php echo $datepost;?></td>
				<td align="center">
			<a href="index.php?option=phanmem&cat=delete&id=<?php echo $id?>">
			<?php echo $delete;?>
			</a>
		</td>
		<td align="center">
			<a href="index.php?option=phanmem&cat=update&id=<?php echo $id?>">
			<?php echo $update;?>
			</a>
		</td>
	
	</tr>
	<?php
		}
	?>
</table>